package com.haoze.nurseapp.controller;

import com.haoze.common.response.Result;
import com.haoze.common.response.ResultGenerator;
import com.haoze.nurseapp.dto.patient.PendingPatientQueryDTO;
import com.haoze.nurseapp.service.InHospitalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wangze
 * @date 2020/06/29
 **/

@RestController("/nurseapp/inHospital")
@Api(value = "入院", tags = "入院")
public class InHospitalController {
    @Resource
    private InHospitalService inHospitalService;

    @GetMapping("/queryPendingPatients")
    @ApiOperation(value = "查询待入院病人")
    public Result queryPendingPatient(
            @RequestParam Integer page,
            @RequestParam Integer pageSize
    ) {
        PendingPatientQueryDTO queryDto = new PendingPatientQueryDTO();
        queryDto.setPageNum(page);
        queryDto.setPageSize(pageSize);
        return ResultGenerator.genOkResult(inHospitalService.queryPendingPatients(queryDto));
    }


    @PostMapping("/savePendingPatient")
    @ApiOperation(value = "保存待入院病人")
    public Result savePendingPatient(
    ) {
        return ResultGenerator.genOkResult();
    }
}
